﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;
using System.Drawing;
using ConsoleApplicationXmlSerTest.model;

namespace ConsoleApplicationXmlSerTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //XmlSerializer s = new XmlSerializer(typeof(Example));

            //StringWriter sw = new StringWriter();
            //s.Serialize(sw, new Example("neki tekst", 45, Type.laptop, DateTime.Now));
            //string xml = sw.ToString();
            //Console.WriteLine(xml);
            //File.WriteAllText("proba.xml", xml);

            //TextReader tr = new StreamReader("proba.xml");
            //Example novi = (Example)s.Deserialize(tr);
            //tr.Close();


            //XmlSerializer s = new XmlSerializer(typeof(measurement));
            //TextReader tr = new StreamReader("test634399558195633840.xml");
            //measurement novi = (measurement)s.Deserialize(tr);
            //novi.parseValuesFromString();
            //tr.Close();

            //using (var db = new DBContext())
            //{
            //    db.Measurements.Add(novi);
            //    int records = db.SaveChanges();
            //    Console.WriteLine("{0} record(s) saved", records);
            //}
            measurement mm = new measurement();
            mm.deviceType = (DeviceType)2;
            int s = (int)mm.deviceType;


            using (var db = new DBContext())
            {
                measurement m = db.Measurements.SingleOrDefault();
               
            }
        }
    }
}
